#ifndef _CONFIGTABLE_H_
#define _CONFIGTABLE_H_

#include <string>
#include <vector>
#include <unordered_map>

class Configtable {
private:
    int s_num;
    int c_num;
    int max_percent_5;
    int qos_constraint;
    std::vector<std::string> cid_list;
    std::vector<std::string> sid_list;
    std::vector<double> max_percent_5_ratio;
    std::unordered_map<std::string, int> cid_index;
    std::unordered_map<std::string, int> sid_index;
    std::vector<int> bandwidth;
    std::vector<std::vector<int>> qos;
    std::vector<int> degree_sort;
    void load_config(std::string datadir);
public:
    Configtable(std::string datadir);
    int get_cnum();
    int get_snum();
    int get_max_percent_5();
    std::vector<double> get_max_percent_5_ratio();
    std::vector<std::string> get_cid_list();
    std::vector<std::string> get_sid_list();
    std::string get_cid(int index);
    std::string get_sid(int index);
    int get_cid_index(std::string cid);
    int get_sid_index(std::string sid);
    int get_bandwidth(std::string sid);
    int get_bandwidth(int sid_index);
    bool check_bandwidth(std::string sid, int bw);
    bool check_bandwidth(int sid_index, int bw);
    int get_qos_constraint();
    int get_qos(std::string sid, std::string cid);
    int get_qos(std::string sid, int cid_index);
    int get_qos(int sid_index, std::string cid);
    int get_qos(int sid_index, int cid_index);
    bool check_qos(std::string sid, std::string cid);
    bool check_qos(std::string sid, int cid_index);
    bool check_qos(int sid_index, std::string cid);
    bool check_qos(int sid_index, int cid_index);
    std::vector<int> get_degree_sort();
    ~Configtable();
};

#endif